import time

from selenium.webdriver.common.by import By
from Base import Base

class Page2(Base):

    #点击首页
    dj = (By.XPATH,'/html/body/div[3]/div[2]/ul/li[1]/a')
    def de(self):
        self.click(self.dj)
    #点击商品定位
    sp_loc = (By.XPATH,'/html/body/div[8]/div[1]/div[2]/div[2]/ul/li[1]/div[1]/a/img')
    #点击商品定位定位
    def sp(self):
        self.click(self.sp_loc)

    #点击立即购买定位
    ljgm_loc = (By.ID,'buy-cart')
    # 点击立即购买方法
    def ljgm(self):
        self.click(self.ljgm_loc)

    #确认收货地址
    dizhi = (By.ID,'address-255')
    def di(self):
        self.click(self.dizhi)

    #选择支付方式
    zhifu = (By.XPATH,'/html/body/div[4]/form/div[3]/div[2]/div[1]/label/input')
    def fukuan(self):
        self.click(self.zhifu)

    #点击下一步
    xyb = (By.ID,'order-button')
    def xybu(self):
        self.click(self.xyb)


    def A3Mall(self):
        self.de()
        time.sleep(2)
        self.sp()
        time.sleep(2)
        self.ljgm()
        time.sleep(2)
        self.di()
        time.sleep(2)
        self.fukuan()
        time.sleep(2)
        self.xybu()
        time.sleep(5)
